<template>
    <div>
        <!-- 引入面包屑导航 -->
        <el-bread></el-bread>
        <el-button @click="addList" type="primary" plain class="addBtn" size="mini">添加</el-button>

        <v-list @edit="edit"></v-list>

        <v-dialog :zhe="zhe" :isAdd="isAdd" @close="close" ref="dialogRef"></v-dialog>

    </div>
</template>
<script>
import vList from "./list.vue"
import vDialog from "./dialog.vue"
export default {
    data() {
        return {
            moren: "菜单地址",
            form: {

            },
            zhe: false,
            isAdd: true

        }
    },
    methods: {
        // 点击添加按钮
        addList() {
            this.zhe = true
            this.isAdd = true
        },
        // 点击关闭
        close() {
            this.zhe = false
        },
        // 点击修改
        edit(e) {
            // console.log(e);
            this.zhe = true
            this.isAdd = false
            // 通过ref来调用子组件里面的方法
            this.$refs.dialogRef.lookup(e)

        }

    },
    mounted() {

    },
    watch: {},
    computed: {},
    filters: {},
    components: {
        vList, vDialog
    }
}
</script>
<style scoped>
.addBtn {
    margin: 20px 0 20px 0;

}

.table {
    min-width: 1070px;
}
</style>